﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/static/";
%>
<!DOCTYPE html>
<%--开票申请--%>
<html lang="en">
	<head>
		<base href="<%=basePath%>">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>开票申请</title>
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
		
		<link rel="stylesheet" href="static/ace/css/bootstrap.css" />
		<link rel="stylesheet" href="static/ace/css/font-awesome.css" />
		
		<!-- text fonts -->
		<link rel="stylesheet" href="static/ace/css/ace-fonts.css" />
		<!-- ace styles -->
		<link rel="stylesheet" href="static/ace/css/ace.css" class="ace-main-stylesheet" id="main-ace-style" />

		<link rel="stylesheet" type="text/css"
			  href="plugins/websocketInstantMsg/ext4/resources/css/ext-all.css" />

		<script type="text/javascript" src="plugins/websocketInstantMsg/ext4/ext-all-debug.js"></script>
		<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
	</head>
	<body class="no-skin">

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">
			<div id="output"></div>
		</div>

		<script type="text/javascript">
			Ext.onReady(function () {
				var store = Ext.create('Ext.data.Store', {
					fields: ["billCode", "ladingBillCode", "loadingGoingShips", "cataTitle", "cataObjectName", "cataeditstatusName",
						"cataPublishName", "cataEndDate", "holyUpdateTime", "catapushtime"],
					pageSize: 1,  //页容量5条数据
					//是否在服务端排序 （true的话，在客户端就不能排序）
					remoteSort: false,
					remoteFilter: true,
					proxy: {
						type: 'ajax',
						url: '../bookingCargo/list',
						reader: {   //这里的reader为数据存储组织的地方，下面的配置是为json格式的数据，例如：[{"total":50,"rows":[{"a":"3","b":"4"}]}]
							type: 'json', //返回数据类型为json格式
							root: 'result.list',  //数据
							totalProperty: 'result.total' //数据总条数
						}
					},
					sorters: [{
						//排序字段。
						property: 'ordeId',
						//排序类型，默认为 ASC
						direction: 'desc'
					}],
					autoLoad: true  //即时加载数据
				});

				var grid = Ext.create('Ext.grid.Panel', {
					renderTo: "output",
					store: store,
	//				height: "100%",
					height: document.documentElement.clientHeight,
	//				width: 800,
					stripeRows:true,
					columnLines: true,
					selModel:Ext.create('Ext.selection.CheckboxModel',{mode:"single", allowDeselect: true, showHeaderCheckbox:false}),
					columns: [
						{text: '托单编号', dataIndex: 'billCode', align: 'left', maxWidth: 100 ,locked: true},
						{text: '提单号', dataIndex: 'ladingBillCode', maxWidth: 200 ,locked:true},
						{text: '海船装区', dataIndex: 'loadingGoingShips', align: 'left', minWidth: 80},
						{text: '订舱状态', dataIndex: 'bookingStatus', maxWidth: 80, align: 'left'},
						{text: 'msc提单号', dataIndex: 'mscBillCode', maxWidth: 80},
						{text: '托运人', dataIndex: 'SHIPPER_ID', maxWidth: 80},
						{text: '订舱人员', dataIndex: 'bookingClerk', maxWidth: 80},
						{text: '箱主', dataIndex: 'BOX_MASTER_KEY', maxWidth: 80},
						{text: '箱型箱量', dataIndex: 'boxTypeConfirm', maxWidth: 80},
						{text: '指定预计海船期', dataIndex: 'appointEstimateShipTime', maxWidth: 80},
						{text: '指定海船航线', dataIndex: 'appointShipRoute', maxWidth: 80},
						{text: '订舱海船航线', dataIndex: 'bookingShippingRoutes', maxWidth: 80},
						{text: '订舱海船期', dataIndex: 'bookingSeagoingVessels', maxWidth: 80},
						{text: '预计放箱时间', dataIndex: 'estimatePutBoxTime', maxWidth: 80},
						{text: '20', dataIndex: '', maxWidth: 80},
						{text: '40', dataIndex: '', maxWidth: 80},
						{text: '40H', dataIndex: '', maxWidth: 80},
						{text: '特种箱', dataIndex: '', maxWidth: 80},
						{text: 'TEU', dataIndex: '', maxWidth: 80},
						{text: '货物种类', dataIndex: 'goodsType', maxWidth: 80},
						{text: '件数', dataIndex: 'goodsNumber', maxWidth: 80},
						{text: '包装类别', dataIndex: '', maxWidth: 80},
						{text: '货物毛重', dataIndex: 'goodsGrossWeight', maxWidth: 80},
						{text: '箱货总重', dataIndex: '', maxWidth: 80},
						{text: '总体积', dataIndex: 'volume', maxWidth: 80},
						{text: '贸易类型', dataIndex: 'tradeTypeId', maxWidth: 80},
						{text: '接单时间', dataIndex: 'createTime', maxWidth: 80},
						{text: '业务员', dataIndex: '', maxWidth: 80},
						{text: '货代客服', dataIndex: 'forwarderCustomerService', maxWidth: 80},
						{text: '运输条款', dataIndex: 'transportClause', maxWidth: 80},
						{text: '报关票数', dataIndex: 'customsNumber', maxWidth: 80},
						{text: '贸易方式', dataIndex: 'tradeMethod', maxWidth: 80},
						{text: '中文品名', dataIndex: 'chineseName', maxWidth: 80},
						{text: '装运港', dataIndex: 'RIVER_PORT_ID', maxWidth: 80},
						{text: '订舱卸货港', dataIndex: 'bookingDischargingPort', maxWidth: 80},
						{text: '订舱交货地', dataIndex: 'bookingPlaceDelivery', maxWidth: 80},
						{text: '卸货港', dataIndex: '', maxWidth: 80},
						{text: '交货地', dataIndex: '', maxWidth: 80},
						{text: '预计江船装船时间', dataIndex: 'estimateRiverBoatTime', maxWidth: 80},
						{text: '订舱备注', dataIndex: 'bookingOperationNotes', maxWidth: 80},
						{text: '唛头', dataIndex: 'shippingMark', maxWidth: 80},
						{text: '海船周次', dataIndex: 'sailingTimes', maxWidth: 80}
					],
					bbar: [{
						xtype: 'pagingtoolbar',
						store: store,
						displayMsg: '显示 {0} - {1} 条，共计 {2} 条',
						emptyMsg: "没有数据",
						beforePageText: "当前页",
						afterPageText: "共{0}页",
						displayInfo: true
					}],
					listeners: {
						'itemclick': function (view, record, item, index, e) {
	//                    Ext.MessageBox.alert("标题", record.data.cataId);
						}
					},
					tbar: [
						{text: '新增', icon:'../plugins/ext4/shared/icons/fam/add.png', handler: showAlert}, "-",
						{text: '编辑', iconCls: 'a_edit2', handler: showAlert}, "-",
						{text: '停用/启用', iconCls: 'a_lock'}, "-",
						{text: '发布', iconCls: 'a_upload', handler: showAlert}, "-",
						{text: '组织型录', iconCls: 'a_edit', handler: showAlert}, "-",
						{text: '管理商品', iconCls: 'a_edit', handler: showAlert}, "-",
						"->", {iconCls: "a_search", text: "搜索", handler: showAlert}],
				});

				function showAlert() {
	//            var selectedData = grid.getSelectionModel().getSelection()[0].data;
					store.load({ params: { abcd: 'test',test:666} });
				}

				function convert(val) {
					return Ext.util.Format.date(new Date(val), 'Y-m-d');
				}

			});
		</script>
	</body>
</html>